import 'package:flutter/material.dart';

import 'package:flutter/cupertino.dart';
import 'package:provider/provider.dart';
import 'package:s_mankey/config/resource_mananger.dart';
import 'package:s_mankey/view_model/login_vmodel.dart';

/// 数据加载出错Widget
class datasErrorWidget extends StatelessWidget {

  final errorTip;

  datasErrorWidget({Key key, this.errorTip}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Center(child: Text(errorTip,style: TextStyle(fontSize: AppFontSize.Size22),),);
  }
}


/// 没有登录时 但已经发起请求的错误显示
class unLoginErrorTip extends StatelessWidget {

  final errorTip;
  BuildContext context;

  unLoginErrorTip({Key key, this.errorTip, this.context}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    var model = Provider.of<LoginVModel>(context);
    return model.isLogin? datasErrorWidget(errorTip: errorTip,): Text('');
  }
}
